var assert = require('assert');
var should = require('should');
var util = require('util');
var _ = require('lodash');
var dailyTaskModel = require('../../app/models/dailyTaskModel');
var config = require('../config');

suite('测试dailyTaskModel', function () {
    var daily_task_model;
    setup(function (done) {
        dailyTaskModel.getByRoleId(config.role_id, function (err, model) {
            assert.equal(err == null, true);
            daily_task_model = model;
            done();
        });
    });

    suite('getCurrentTaskList', function () {
        test('获取当前的任务', function () {
            daily_task_model.getCurrentTaskList();
        });
    });

    suite('addDailyActive', function () {
        test('添加活跃值', function (done) {
            assert.equal(daily_task_model.addDailyActive(10));
            daily_task_model.save(function () {
                done();
            });
        });
    });

    suite('addReceiveActiveId', function () {
        test('添加已经领取活跃度id', function (done) {
            assert.equal(daily_task_model.addReceiveActiveId(50));
            done();
        });
    });

    suite('isActiveReceive', function () {
        test('是否可领取活跃度奖励', function (done) {
            daily_task_model.isActiveReceive(10);
            done();
        });
    });
});
